package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouXsfpMapper;
import com.ruoyi.system.domain.SysYongyouXsfp;
import com.ruoyi.system.service.ISysYongyouXsfpService;

/**
 * 销售发票Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouXsfpServiceImpl implements ISysYongyouXsfpService 
{
    @Autowired
    private SysYongyouXsfpMapper sysYongyouXsfpMapper;

    /**
     * 查询销售发票
     * 
     * @param orgname 销售发票主键
     * @return 销售发票
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouXsfp selectSysYongyouXsfpByOrgname(String orgname)
    {
        return sysYongyouXsfpMapper.selectSysYongyouXsfpByOrgname(orgname);
    }

    /**
     * 查询销售发票列表
     * 
     * @param sysYongyouXsfp 销售发票
     * @return 销售发票
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouXsfp> selectSysYongyouXsfpList(SysYongyouXsfp sysYongyouXsfp)
    {
        return sysYongyouXsfpMapper.selectSysYongyouXsfpList(sysYongyouXsfp);
    }

    /**
     * 新增销售发票
     * 
     * @param sysYongyouXsfp 销售发票
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouXsfp(SysYongyouXsfp sysYongyouXsfp)
    {
        return sysYongyouXsfpMapper.insertSysYongyouXsfp(sysYongyouXsfp);
    }

    /**
     * 修改销售发票
     * 
     * @param sysYongyouXsfp 销售发票
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouXsfp(SysYongyouXsfp sysYongyouXsfp)
    {
        return sysYongyouXsfpMapper.updateSysYongyouXsfp(sysYongyouXsfp);
    }

    /**
     * 批量删除销售发票
     * 
     * @param orgnames 需要删除的销售发票主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouXsfpByOrgnames(String[] orgnames)
    {
        return sysYongyouXsfpMapper.deleteSysYongyouXsfpByOrgnames(orgnames);
    }

    /**
     * 删除销售发票信息
     * 
     * @param orgname 销售发票主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouXsfpByOrgname(String orgname)
    {
        return sysYongyouXsfpMapper.deleteSysYongyouXsfpByOrgname(orgname);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteByDateRange(String startDate)
    {
        return sysYongyouXsfpMapper.deleteByDateRange(startDate);
    }
}
